package 曾世昌12_8.zuoye11;

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.util.Properties;
import java.util.Set;

public class test {
    public static void main(String[] args) throws IOException {
        Properties pro = new Properties();
        pro.setProperty( "uid","001" );
        pro.setProperty( "username","jack" );
        pro.setProperty( "password","123" );
        Set<String> str = pro.stringPropertyNames();
        String str1="";
        for (String s : str) {
            String v = pro.getProperty( s );
            str1+=s+"="+v+"\r\n";
        }
        FileUtils.writeStringToFile( new File( "t4.properties" ),str1 );
    }
}
